package com.weichen.studentgameexchange.gateway.config;

import java.security.SecureRandom;
import java.util.Base64;

/**
 * 功能：生成密钥
 * 作者：惟尘
 * 日期：2025/2/7 23:03
 */
public class JwtKeyGenerator {
    public static String generateKey() {
        SecureRandom random = new SecureRandom();
        byte[] keyBytes = new byte[32]; // 256位密钥
        random.nextBytes(keyBytes);
        return Base64.getEncoder().encodeToString(keyBytes);
    }
}
